package com.liaoye.demo_04;

public class OuterDemo {
    public static void main(String[] args) {
        Outer.method().show();
    }
}

interface Inter {
    void show();
}

class Outer {
    public static Inter method() {
        /*class InterImpl implements Inter {
            @Override
            public void show() {
                System.out.println("Hello World");
            }
        }
        return new InterImpl();*/

        return new Inter() {
            @Override
            public void show() {
                System.out.println("Hello World");
            }
        };
    }
}
